home *** CD-ROM | disk | FTP | other *** search
/ The History of Denim / The History of Denim.iso / pc / floatlib.cst / 00001_Creating Pallettes.ls next >
Encoding:
Text File  |  1997-11-14  |  5.7 KB  |  204 lines

  1. --Code for all 5 main sections, the floating pallettes use this functionality
  2. --  put in start movie of First Animation: NewPallette 1
  3.  
  4. on NewPallette_Navigation
  5.   if CheckWindow("Navigation") then
  6.     nothing 
  7.   else
  8.     cursor [member "Wait", member "Waitmask"]
  9.     global NavigationWindow, HelpWindow
  10.     set the windowType of window  "Navigation" to 2
  11.     set NavigationWindow to window "Navigation"
  12.     set the fileName of NavigationWindow to "nav.dir"
  13.     set temp = todesktop (rect(8, 395, 392, 476))
  14.     set the rect of window "Navigation" = temp
  15.     open NavigationWindow
  16.     --put "opening Navigation Window"
  17.     cursor 0
  18.   end if
  19. end
  20.  
  21.  
  22. on NewPallette_Printads 
  23.   if CheckWindow("Printads") then
  24.     nothing 
  25.   else
  26.     cursor [member "Wait", member "Waitmask"]
  27.     --The floater that displays Print ads
  28.     set the windowType of window  "Printads" to 2
  29.     set NavigationWindow to window "Printads"
  30.     set the fileName of NavigationWindow to "_brands2.dir"
  31.     set the rect of window "Printads" = todesktop (rect(88, 2, 552, 476))
  32.     open NavigationWindow
  33.     cursor 0
  34.   end if
  35. end
  36.  
  37.  
  38. on NewPallette_Search
  39.   if CheckWindow("Search") then
  40.     nothing 
  41.   else
  42.     cursor [member "Wait", member "Waitmask"]
  43.     --The floater that displays Search
  44.     set the windowType of window  "Search" to 2
  45.     set NavigationWindow to window "Search"
  46.     set the fileName of NavigationWindow to "search.dir"
  47.     set the rect of window "Search" = todesktop (rect(158,45,382,435))
  48.     open NavigationWindow
  49.     cursor 0
  50.   end if
  51. end
  52.  
  53.  
  54. on NewPallette_Help
  55.   if CheckWindow("Help") then
  56.     nothing 
  57.   else
  58.     cursor [member "Wait", member "Waitmask"]
  59.     --The floater that displays Help
  60.     set the windowType of window  "Help" to 2
  61.     set NavigationWindow to window "Help"
  62.     set the fileName of NavigationWindow to "help.dir"
  63.     set the rect of window "Help" = todesktop (rect(232,128,408,351))
  64.     open NavigationWindow
  65.     cursor 0
  66.   end if
  67. end
  68.  
  69.  
  70. on NewPallette_TVads
  71.   if CheckWindow("TVads") then
  72.     nothing 
  73.   else
  74.     cursor [member "Wait", member "Waitmask"]
  75.     --turn off sound for QuickTime
  76.     Shutup
  77.     --The floater that displays TV Ads
  78.     set the windowType of window  "TVads" to 2
  79.     set NavigationWindow to window "TVads"
  80.     set the fileName of NavigationWindow to "_brands3.dir"
  81.     set temp = todesktop (rect(88, 2, 552, 476))
  82.     set the rect of window "TVads" = temp
  83.     open NavigationWindow
  84.     cursor 0
  85.   end if
  86. end
  87.  
  88.  
  89. on NewPallette_Internet
  90.   if CheckWindow("internet") then
  91.     nothing 
  92.   else
  93.     cursor [member "Wait", member "Waitmask"]
  94.     --The floater that displays internet ads
  95.     set the windowType of window  "internet" to 2
  96.     set NavigationWindow to window "internet"
  97.     set the fileName of NavigationWindow to "_brands4.dir"
  98.     set the rect of window "internet" = todesktop (rect(72, 60, 568, 430))
  99.     open NavigationWindow
  100.     cursor 0
  101.   end if
  102. end
  103.  
  104.  
  105. on NewPallette_Brands
  106.   if CheckWindow("Brands_Navigation") then
  107.     nothing 
  108.   else
  109.     cursor [member "Wait", member "Waitmask"]
  110.     --The floater that has the countries in it
  111.     set the windowType of window  "Brands_Navigation" to 2
  112.     set the fileName of window  "Brands_Navigation" to "_brands1.dir"
  113.     set temp = todesktop (rect(87, 143, 257, 413))
  114.     set the rect of window "Brands_Navigation" = temp
  115.     open window "Brands_Navigation"
  116.     cursor 0
  117.   end if
  118. end
  119.  
  120.  
  121. on NewPallette_Mills
  122.   if CheckWindow("Mills_Navigation") then
  123.     --alert the windowlist
  124.   else
  125.     cursor [member "Wait", member "Waitmask"]
  126.     --The floater that has the countries in it
  127.     set the windowType of window  "Mills_Navigation" to 2
  128.     set the fileName of window  "Mills_Navigation" to "_Mills1.dir"
  129.     set temp = todesktop (rect(87, 143, 257, 413))
  130.     set the rect of window "Mills_Navigation" = temp
  131.     open window "Mills_Navigation"
  132.     cursor 0
  133.   end if
  134. end
  135.  
  136.  
  137. on NewPallette_Outdoor
  138.   if CheckWindow("internet") then
  139.     nothing 
  140.   else
  141.     cursor [member "Wait", member "Waitmask"]
  142.     --The floater that displays internet ads
  143.     set the windowType of window  "Outdoor" to 2
  144.     set NavigationWindow to window "Outdoor"
  145.     set the fileName of NavigationWindow to "_market2.dir"
  146.     set temp = todesktop (rect(88, 2, 552, 476))
  147.     set the rect of window "Outdoor" = temp
  148.     open NavigationWindow
  149.     cursor 0
  150.   end if
  151. end
  152.  
  153.  
  154. on CheckWindow TheWindow
  155.   --returns true if the window is present
  156.   set OpenWin = the windowlist
  157.   set Test = false
  158.   repeat with aa = 1 to count (OpenWin)
  159.     set killit = getat(OpenWin,aa)
  160.     delete char 1 to 9 of killit
  161.     delete the last char of killit
  162.     delete the last char of killit
  163.     if killit = TheWindow then
  164.       set Test = true
  165.     end if
  166.   end repeat
  167.   return Test
  168. end
  169.  
  170.  
  171.  
  172. on Nav SectionCode
  173.   --List of sections the SectionCode refers to
  174.   --did this so there'de be no spelling errorrs
  175.   
  176.   set SectionList = ["_brands.dir","_mills.dir","_styles.dir","_treat.dir","_market.dir","_Time.dir","main.dir"]
  177.   
  178.   tell the stage to go to frame "Main"  of movie getat(SectionList, SectionCode)
  179. end
  180.  
  181.  
  182. on MoveWindow Who, DeltaX, DeltaY
  183.   --this moves the pallette around, tedious, but
  184.   --used becasause we want to design the topbar
  185.   set WindowAt = the rect of window Who
  186.   setat (WindowAt,1, (getat (WindowAt,1) + DeltaX))
  187.   setat (WindowAt,3, (getat (WindowAt,3) + DeltaX))
  188.   setat (WindowAt,2, (getat (WindowAt,2) + DeltaY))
  189.   setat (WindowAt,4, (getat (WindowAt,4) + DeltaY))
  190.   set the rect of window Who = WindowAt
  191.   --put "Moving " & Who & " Window"
  192. end
  193.  
  194.  
  195. on todesktop Myrect
  196.   set MyDesktop = getat(the deskTopRectList,1)
  197.   if getat (MyDesktop, 3) <> 640 then
  198.     set Myover = (getat(MyDesktop, 3)-640)/2
  199.     set Mydown = (getat(MyDesktop, 4)-480)/2
  200.     return (Myrect +  rect (Myover,Mydown,Myover,Mydown,))
  201.   else
  202.     return Myrect
  203.   end if
  204. end